#!/usr/bin/perl -w
# Author: Allen Hutchison
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#      Unless required by applicable law or agreed to in writing, software
#      distributed under the License is distributed on an "AS IS" BASIS,
#      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#      See the License for the specific language governing permissions and
#      limitations under the License.
#
# Unit tests for Oaf::Test

use lib "../";
use Test::More tests => 8;

use strict;
use warnings;

BEGIN { use_ok('Oaf::Test') };

my $test = Oaf::Test->new('1 /bin/ls -al', # Feed a test test into the object.
			  'oaf.config_file' => 'test_config_file');
ok((defined($test) and (ref $test eq 'Oaf::Test')), 'new() test');

is($test->id(), 1, 'id get test');
is($test->test(), '/bin/ls', 'test get test');
is($test->args(), '-al', 'args get test');

$test->start_time(1);
$test->end_time(5);
is($test->duration(), 4, 'duration test');

$test->exit_code(1);
is($test->exit_code_string(), 'Test Failed', 'exit_code_string failure test');

$test->exit_code(0);
is($test->exit_code_string(), 'Test Passed', 'exit_code_string pass test');

